package com.loren.demo03.tcp2.codec;

import com.loren.demo03.tcp0.CustomProtocol;
import com.loren.demo03.tcp0.MessageCodec;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

public class CustomEncoder extends MessageToByteEncoder<CustomProtocol> {
    @Override
    protected void encode(ChannelHandlerContext ctx, CustomProtocol msg, ByteBuf out) {
        new MessageCodec().write(msg, out);
    }
}
